﻿<!-- 
News Framework
(C) Tanzim Saqib. Oct 25, 2010.
http://TanzimSaqib.com | http://newsfx.codeplex.com
-->
    
<UserControl x:Class="TanzimSaqib.NewsFramework.MainPanorama"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    xmlns:fx="clr-namespace:TanzimSaqib.NewsFramework;assembly=TanzimSaqib.NewsFramework" 
    fx:Command.Attach="Loaded=MainPanorama_Load"
    Background="{Binding BackgroundImageSource}"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.DataContext>
        <fx:MainPanoramaViewModel />
    </UserControl.DataContext>

    <controls:Panorama fx:Command.Attach="Loaded=LoadPanorama">

        <controls:Panorama.Title>
            <StackPanel Orientation="Horizontal" Margin="0,80,0,0">
                <Image x:Name="icon" Source="/ApplicationIcon.png" Height="51" Width="51" Margin="0,0,10,0"/>
                <TextBlock Text="{Binding PageTitle}" FontStyle="Italic" FontFamily="Segoe WP Bold" FontSize="20" VerticalAlignment="Center"/>
            </StackPanel>
        </controls:Panorama.Title>

        <!--Panorama item two-->
        <!--Use 'Orientation="Horizontal"' to enable a panel that lays out horizontally-->
        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="{Binding PanoramaLatestHeader, Mode=OneWay}" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with image placeholder and text wrapping-->
            <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Latest}" fx:Command.Attach="SelectionChanged=Latest_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="0,0,0,30" Width="450">
                            <!--Replace rectangle with image-->
                            <Image Source="{Binding LineTwo}" Height="100" Width="100" />
                            <!-- <Rectangle Height="100" Width="100" Fill="#FFE5001b" /> -->
                            <StackPanel Width="340">
                                <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}"/>
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </controls:PanoramaItem>

        <!--Panorama item one-->
        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="categories" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with text wrapping-->
            <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Categories}" fx:Command.Attach="SelectionChanged=Categories_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="0,0,0,17" Width="432">
                            <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}"/>
                            <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </controls:PanoramaItem>

        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="saved" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with image placeholder and text wrapping-->
            <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Saved}" fx:Command.Attach="SelectionChanged=Saved_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="0,0,0,30" Width="450">
                            <!--Replace rectangle with image-->
                            <Image Source="{Binding LineTwo}" Height="100" Width="100" />
                            <!-- <Rectangle Height="100" Width="100" Fill="#FFE5001b" /> -->
                            <StackPanel Width="340">
                                <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}"/>
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </controls:PanoramaItem>

        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="search" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with text wrapping-->
            <StackPanel>
                <TextBox Text="{Binding SearchText}" fx:Command.Attach="TextChanged=SearchText_TextChanged" />
                <Button Content="Search" fx:Command.Attach="Click=Search_Click" IsEnabled="{Binding CanSearch}" />
            </StackPanel>
        </controls:PanoramaItem>

        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="about" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with text wrapping-->
            <StackPanel>

                <TextBlock TextWrapping="Wrap" Text="© Tanzim Saqib 2010. All rights reserved."/>
                <TextBlock TextWrapping="Wrap" Text="This Windows Phone 7 application is powered by News Framework. It is a framework on which any RSS based news website can have its own Windows Phone application in minutes. For more information, please visit:"/>
                <Button Content="http://newsfx.codeplex.com" fx:Command.Attach="Click=VisitHomePage" />

            </StackPanel>
        </controls:PanoramaItem>

    </controls:Panorama>

    <!--Panorama-based applications should not show an ApplicationBar-->
</UserControl>
